package com.itany.corejava.day07;

public class Test4 {
    public static void main(String[] args) {
        // B b=new B();
        // b.setI(3);
        // System.out.println(b.getI());
        A a=new A();
        f(a);
        B b=new B();
        f(b);
        A ab=new B();
        f(ab);
    }

    public static void f(A a){
        System.out.println("a");
    }
    public static void f(B b){
        System.out.println("b");
    }
}

class A{
    private int i=1;

    public int getI() {
        return i;
    }
}
class B extends A {
    private int i=2;

    public void setI(int i) {
        this.i = i;
    }
}
